package test;

import gapidt.nlp.SemanticAnalyzer;
import gapidt.nlp.SemanticParser;

import org.apache.commons.math.stat.correlation.PearsonsCorrelation;

public class CohesionVsAmbiguity {

	public static void main(String[] args) {
		
		// Clase presenta el antipatrón nombre de método ambiguo 
		double[] x = {0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0};
		// El detector de cohesión detectó al menos un falso positivo en la clase
		double[] y = {0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0};
		
		PearsonsCorrelation corr = new PearsonsCorrelation();
		double result = corr.correlation(x, y);
		
		System.out.println("Correlation: "+result);
		
		
		System.setProperty(SemanticParser.LEXICALIZED_PARSER_FILE_PROPERTY, "F:/tesis/gapidt/resources/external/lexparser/englishPCFG.ser");
		System.out.println("TREE: ");
		System.out.println(SemanticParser.parseSemanticTree("it must buy car"));
		System.out.println(SemanticParser.parseSemanticTree("it must car"));
		System.out.println(SemanticParser.parseSemanticTree("it must create send ticket"));
	}

}
